<template>
  <el-col :span="12">
    <div class="row">
      <!-- <el-avatar v-for="item in list" :key="item.accountId" :value="item.accountId" class="mr10" :size="60" icon="el-icon-user-solid" :src="item.avatarUrl" /> -->
      <div class="mt20">
        <el-select
          v-model="value"
          clearable
          placeholder="请选择"
          :style="'width:' + (width)"
          size="medium"
          filterable
          @change="change"
        >
          <el-option>类目</el-option>
          <el-option>品牌</el-option>
          <el-option>所属电商</el-option>
          <el-option>所在仓库</el-option>
        </el-select>
      </div>
    </div>
  </el-col>
</template>

<script>
export default {
  props: {
    width: {
      type: String,
      default: ''
    },
    value: {
      // type: String,
      // default: ''
      type: [Array, String, Number],
      default() {
        return []
      }
    }
  },
  data() {
    return {
      list: [],
      accountInfo: {}
    }
  },
  watch: {

  },
  created() {
  },
  methods: {
    /**
     * 格式化地址
    */
    change(v) {
      const selected = this.list.filter(item => { return item.accountId === v })[0]
      this.accountInfo = selected
      this.$emit('change', v, selected)
    }
  }
}
</script>

<style lang="scss" >
</style>
